<?PHP 
session_start();

if (!array_key_exists('SID', $_SESSION)) {
	header("Location: index.php");
   	exit;
}

require_once('../db.php');
require_once("classes/classNotas.php");
require_once("classes/classEditor.php");
require_once("classes/classAlbum.php");
require_once("classes/classUtils.php");



$myEditor = new Editor();

if(isset($_GET["getout"]) && $_GET["getout"] == 1)
{
	$myEditor->cerrarSesion();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Editor MasMedio.com</title>
<link href="css/editor.css" type="text/css" rel="stylesheet" />
<link href="jwysiwyg/jquery.wysiwyg.css" type="text/css" rel="stylesheet" />


</head>

<body>
<div id="backdrop" class="backdrop"></div>
<div id="container">
	<div id="header">
		Bienvenido <b><?PHP echo $_SESSION["AName"];?>!</b>         
		<ul class="menuEditor">
			<li><a href="Editor.php?AX=1">Administrador</a></li>
			<li><a href="Editor.php?AX=2">Notas</a></li>
			<li><a href="Editor.php?AX=3">Comentarios</a></li>
			<li><a href="Editor.php?AX=4">As&iacute; lo Dijo</a></li>
			<li><a href="Editor.php?AX=5">Galer&iacute;as</a></li>
			<li><a href="Editor.php?AX=6">M&aacute;s Imagen</a></li>
			<li><a href="Editor.php?AX=7">Encuesta</a></li>
			<li><a href="Editor.php?AX=8">Videos</a></li>
			<li><a href="Editor.php?AX=9">As&iacute; lo Twiteo</a></li>
			<li><a href="Editor.php?AX=10">Ay No Memes</a></li>
			<li><a href="Editor.php?AX=11">Audios</a></li>
		</ul>
		<div id="subHeader">
			<?PHP include_once('subMenu.php') ?>
		</div>
	</div>
	<?PHP include_once('contextMenu.php'); ?>
	<div style="text-align:right; margin-bottom:5px;">
		<input type="button" value="Cerrar Sesion" onClick="Logout();" style="font-size:9px; background-color:#EDEDED;">
	</div>
	<div id="EditorForms">
		<?PHP
			switch($_GET['BX']){
				case 1:
					include('addNotas.php');
					break;
				case 2:
					include('delNotas.php');
					break;
				case 3:
					include('modNotas.php');
					break;
				case 4:
					include('editarNota.php');
					break;
				case 6:
					include('addAlbum.php');
					break;
				case 7:
					include('addFotos.php');
					break;
				case 10:
					include('addTuFoto.php');
					break;
				case 11:
					include('addMasIntimo.php');
					break;
				case 12:
					include('addAsiLoDijo.php');
					break;
				case 13:
					include('addEncuesta.php');
					break;
				case 14:
					include('addVideo.php');
					break;
				case 15:
					include('addMasParecido.php');
					break;
				case 16:
					include('addAsiLoTwiteo.php');
					break;
				case 17:
					include('modAsiLoTwiteo.php');
					break;
				case 18:
					include('editAsiLoTwiteo.php');
					break;
				case 19:
					include('addAyNoMemes.php');
					break;
				case 20:
					include('delAyNoMemes.php');
					break;
				case 21:
					include('addAudio.php');
					break;
				case 22:
					include('delAudio.php');
					break;
                case 23:
                    include('delComentario.php');
                    break;
                case 24:
                    include('delVideos.php');
                    break;
			}
		?>
    </div>
    
</div>
<script language="javascript" type="text/javascript">
function Logout()
{
	document.getElementById("backdrop").style.visibility= "visible";
	var msg = confirm("Estas seguro que quieres Cerrar la sesion?");
	if(msg == false)
	{
	document.getElementById("backdrop").style.visibility= "hidden";
	}
	if(msg == true)
	{
		window.location = 'Editor.php?getout=1';
	}
}
</script>
</body>
</html>
